package com.bzy.controller;

import com.bzy.User;
import com.bzy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ Author     : Bzy.
 * @ Date       : 2020/12/28 -- 18:45
 * @ Version:     $ 1.0
 */
@Controller
public class UserController {

    @Autowired
    private UserService  userService;

    @RequestMapping("/all_users")
    public String  getAllUser(Model  model){
        List<User> user = userService.getAllUser();

        model.addAttribute("user",user);
        return "get_users";
    }
}
